
*********Model 1
logit sec_defect_dummy c.totalstudents_20log##i.Westernsupportdummy i.regime_change c.camp_size c.repression c.diversity i.democ_dum c.lag_lngdp i.reg_sup i.sdirect i.in_media_dum, robust

**ME1
margins, dydx(totalstudents_20log) at (Westernsupportdummy=(0/1) (means)_all)
marginsplot, title("Conditional Marginal Effect of Number of U.S-trained Officers") xsc(range(-0.05 1.05)) xlab(0(1)1) legend(off) recast(scatter) saving(a.gph)

**PP1
margins,  at (totalstudents_20log=(0(0.5)9) Westernsupportdummy =(0/1) (means)_all)
marginsplot, xlab(0(0.2)9.4) xsc(range(-0.05 1.05)) legend(pos(6) col(3)) recast(scatter) saving(b.gph)


*********Model 2 
logit sec_defect_dummy c.totalstudents_20log##i.US_WEST_new i.regime_change c.camp_size c.repression i.sdirect i.in_media_dum diversity i.democ_dum c.lag_lngdp i.reg_sup, robust 

***ME2
margins, dydx(totalstudents_20log) at (US_WEST_new=(0/2) (means)_all)
marginsplot,  xlab(0(1)2) xsc(range(-0.25 2.25)) legend(off) recast(scatter) saving(c.gph) 

***PP2
margins,  at (totalstudents_20log=(0(0.5)9) US_WEST_new =(0/2) (means)_all)
marginsplot, xlab(0(0.2)9.4) xsc(range(-0.05 1.05)) legend(pos(6) col(3)) recast(scatter) saving(d.gph)

***Appendix 

********* Region & year fixed - Table 3A & 4A, Figures 1A, 2A, 3A & 4A


***Model 1 - region
logit sec_defect_dummy c.totalstudents_log##i.Westernsupportdummy i.regime_change camp_size repression diversity i.democ_dum lag_lngdp i.reg_sup i.sdirect i.in_media_dum i.Region, robust 

**ME1
margins, dydx(totalstudents_log) at(Westernsupportdummy=(0/1) (means)_all)
marginsplot, title("Conditional Marginal Effect of Number of U.S-trained Officers")   xlab(0(1)1) legend(off) recast(scatter) 

**PP1
margins,  at (totalstudents_log=(0(0.5)9) Westernsupportdummy =(0/1) (means)_all)
marginsplot,  xlab(0(0.2)9.4) legend(pos(6)) recast(scatter) 


***Model 2 -  region 
logit sec_defect_dummy c.totalstudents_log##i.US_WEST_new i.regime_change camp_size repression sdirect in_media_dum diversity i.democ_dum lag_lngdp i.reg_sup i.Region, robust 

***ME2
margins, dydx(totalstudents_log) at (US_WEST_new =(0/2) (means)_all)
marginsplot, xlab(0(1)2) legend(off) recast(scatter) 

***PP2
margins,  at ( totalstudents_log=(0(0.5)9) US_WEST_new =(0/2) (means)_all)
marginsplot, xlab(0(0.2)9.4) legend(pos(6)) recast(scatter) 


***Model 1 - year
logit sec_defect_dummy c.totalstudents_log##i.Westernsupportdummy i.regime_change camp_size repression diversity i.democ_dum lag_lngdp i.reg_sup i.sdirect i.in_media_dum i.year, robust 

**ME1
margins, dydx(totalstudents_log) at (Westernsupportdummy=(0/1) (means)_all)
marginsplot, title("Conditional Marginal Effect of Number of U.S-trained Officers")   ///
  xlab(0(1)1) ///
legend(off) recast(scatter) 

**PP1
margins,  at (totalstudents_log=(0(0.5)9) Westernsupportdummy =(0/1) (means)_all)
marginsplot,xlab(0(0.2)9.4) legend(pos(6)) recast(scatter) 


***Model 2 -  year
logit sec_defect_dummy c.totalstudents_log##i.US_WEST_new i.regime_change camp_size repression sdirect in_media_dum diversity i.democ_dum lag_lngdp i.reg_sup i.year, robust 

***ME2
margins, dydx(totalstudents_log) at (US_WEST_new =(0/2) (means)_all)
marginsplot, xlab(0(1)2) legend(off) recast(scatter) 

***PP2
margins,  at ( totalstudents_log=(0(0.5)9) US_WEST_new =(0/2) (means)_all)
marginsplot, xlab(0(0.2)9.4) legend(pos(6)) recast(scatter) 


********* alternative U.S training measurements - Table 5A

logit sec_defect_dummy c.totalstudents_20log##i.Westernsupportdummy i.regime_change camp_size repression diversity i.democ_dum lag_lngdp i.reg_sup i.sdirect i.in_media_dum, robust 

logit sec_defect_dummy c.totalstudents_15log##i.Westernsupportdummy i.regime_change camp_size repression diversity i.democ_dum lag_lngdp i.reg_sup i.sdirect i.in_media_dum, robust 

logit sec_defect_dummy c.totalstudents_10log##i.Westernsupportdummy i.regime_change camp_size repression diversity i.democ_dum lag_lngdp i.reg_sup i.sdirect i.in_media_dum, robust 

logit sec_defect_dummy c.totalstudents_20log##i.US_WEST_new i.regime_change camp_size repression diversity i.democ_dum lag_lngdp i.reg_sup i.sdirect i.in_media_dum, robust 

logit sec_defect_dummy c.totalstudents_15log##i.US_WEST_new i.regime_change camp_size repression diversity i.democ_dum lag_lngdp i.reg_sup i.sdirect i.in_media_dum, robust 

logit sec_defect_dummy c.totalstudents_10log##i.US_WEST_new i.regime_change camp_size repression diversity i.democ_dum lag_lngdp i.reg_sup i.sdirect i.in_media_dum, robust 


********* OLS - Table 7A

regress sec_defect_dummy c.totalstudents_log##i.Westernsupportdummy i.regime_change camp_size repression diversity i.democ_dum lag_lngdp i.reg_sup i.sdirect i.in_media_dum, robust 

regress sec_defect_dummy c.totalstudents_log##i.US_WEST_new i.regime_change camp_size repression diversity i.democ_dum lag_lngdp i.reg_sup i.sdirect i.in_media_dum, robust 


********* Table 10A

keep if year>1979

*********Model 1
logit sec_defect_dummy c.totalstudents_10log##i.Westernsupportdummy i.regime_change c.camp_size c.repression c.diversity i.democ_dum c.lag_lngdp i.reg_sup i.sdirect i.in_media_dum, robust

**ME1
margins, dydx(totalstudents_10log) at (Westernsupportdummy=(0/1) (means)_all)
marginsplot, title("Conditional Marginal Effect of Number of U.S-trained Officers") xsc(range(-0.05 1.05)) xlab(0(1)1) legend(off) recast(scatter) saving(a.gph)

**PP1
margins,  at (totalstudents_10log=(0(0.5)9) Westernsupportdummy =(0/1) (means)_all)
marginsplot, xlab(0(0.2)9.4) xsc(range(-0.05 1.05)) legend(pos(6) col(3)) recast(scatter) saving(b.gph)


*********Model 2 
logit sec_defect_dummy c.totalstudents_10log##i.US_WEST_new i.regime_change c.camp_size c.repression i.sdirect i.in_media_dum diversity i.democ_dum c.lag_lngdp i.reg_sup, robust 

***ME2
margins, dydx(totalstudents_10log) at (US_WEST_new=(0/2) (means)_all)
marginsplot,  xlab(0(1)2) xsc(range(-0.25 2.25)) legend(off) recast(scatter) saving(c.gph) 

***PP2
margins,  at (totalstudents_10log=(0(0.5)9) US_WEST_new =(0/2) (means)_all)
marginsplot, xlab(0(0.2)9.4) xsc(range(-0.05 1.05)) legend(pos(6) col(3)) recast(scatter) saving(d.gph)


********* Table 11A

keep if year>1984

*********Model 1
logit sec_defect_dummy c.totalstudents_15log##i.Westernsupportdummy i.regime_change c.camp_size c.repression c.diversity i.democ_dum c.lag_lngdp i.reg_sup i.sdirect i.in_media_dum, robust

**ME1
margins, dydx(totalstudents_15log) at (Westernsupportdummy=(0/1) (means)_all)
marginsplot, title("Conditional Marginal Effect of Number of U.S-trained Officers") xsc(range(-0.05 1.05)) xlab(0(1)1) legend(off) recast(scatter) saving(a.gph)

**PP1
margins,  at (totalstudents_15log=(0(0.5)9) Westernsupportdummy =(0/1) (means)_all)
marginsplot, xlab(0(0.2)9.4) xsc(range(-0.05 1.05)) legend(pos(6) col(3)) recast(scatter) saving(b.gph)


*********Model 2 
logit sec_defect_dummy c.totalstudents_15log##i.US_WEST_new i.regime_change c.camp_size c.repression i.sdirect i.in_media_dum diversity i.democ_dum c.lag_lngdp i.reg_sup, robust 

***ME2
margins, dydx(totalstudents_15log) at (US_WEST_new=(0/2) (means)_all)
marginsplot,  xlab(0(1)2) xsc(range(-0.25 2.25)) legend(off) recast(scatter) saving(c.gph) 

***PP2
margins,  at (totalstudents_15log=(0(0.5)9) US_WEST_new =(0/2) (means)_all)
marginsplot, xlab(0(0.2)9.4) xsc(range(-0.05 1.05)) legend(pos(6) col(3)) recast(scatter) saving(d.gph)
